# https://www.bilibili.com/video/BV1W7411G7wP?p=12&spm_id_from=pageDriver&vd_source=8bd7b24b38e3e12c558d839b352b32f4
import pandas as pd
import matplotlib.pyplot as plt

students = pd.read_excel('../resources/input_py_tools/012/Students.xlsx', index_col='From')
print(students)

# 绘制饼图只需要一个序列
# 默认情况下绘制饼图是使用Series的index来作为图例的
students2017 = students['2017']

# 顺时针，方法1
#students2017 = students2017.sort_values(ascending=True)
#students2017.plot.pie(fontsize=8, startangle=-270)

# 顺时针，方法2
students2017.plot.pie(fontsize=8, counterclock=False, startangle=-270)

plt.title('Source of International Students', fontsize=16, fontweight='bold')
plt.ylabel('2017', fontsize=12, fontweight='bold')
plt.show()